/*
打印二维数组的行数和列数:
int line_number = sizeof(b) / sizeof(b[0]);
int column_number = sizeof(b[0]) / sizeof(int);
line_number=2
column_number=3
打印杨辉三角的前10行:	 
1    
1    1    
1    2    1    
1    3    3    1    
1    4    6    4    1    
1    5    10   10   5    1    
1    6    15   20   15   6    1    
1    7    21   35   35   21   7    1    
1    8    28   56   70   56   28   8    1    
1    9    36   84   126  126  84   36   9    1 
 */
#include<stdio.h>
int main(){
	int b[2][3] = {{1,2,3},{4,5,6}};
	 printf("打印二维数组的行数和列数:\n");
	 int line_number = sizeof(b) / sizeof(b[0]);
	 int column_number = sizeof(b[0]) / sizeof(int);
	 printf("line_number=%d\n",line_number);
	 printf("column_number=%d\n",column_number);

	 printf("打印杨辉三角的前10行:\n");
	 int a[10][10];
	 for(int i = 0 ; i < 10 ; i++){
	 	a[i][0] = 1;
		 for(int j = 1; j < i ; j++){
			a[i][j] = a[i-1][j] + a[i-1][j-1];
		}
		a[i][i] = 1;
	 }
	 for(int i = 0 ; i < 10 ; i++){
	 	for(int j = 0 ; j <= i ; j++){
			printf("%-5d",a[i][j]);
		}
		putchar('\n');
	 }
	 return 0;
}
